package com.cupk.service;

import com.cupk.repository.AdminRepository;
import com.cupk.repository.UserRepository;

/**
 * @author LY
 * @version 1.0
 */
//登录服务
public class LoginService {
    private AdminRepository adminRepository = new AdminRepository();
    private UserRepository userRepository = new UserRepository();

    public Object login(String username, String password, String type){
        Object object = null;
        switch (type){
            case "user":
                object = userRepository.login(username,password);
                break;
            case "admin":
                object = adminRepository.login(username,password);
                break;
        }
        return object;
    }
}
